package main 

import "fmt"

var maxlen int 

type Stack struct {
	len int;
	ary [10]int;
}

var s Stack;

func Push(s *Stack, v int) {
	if (s.len < maxlen) {
		s.ary[maxlen - s.len - 1] = v;
		s.len++; 
	} else {
		fmt.Printf("stack if full ! \n");		
	}	
	
}

func Pop(s *Stack) (v int) {
	if (s.len > 0) {
		v = s.ary[maxlen - s.len];
		s.len--;
	} else {
		fmt.Printf("stack if empty! \n");
	}
	
	return v;	
}

func main() {
	maxlen = 10;
	Push(&s, 2);
	fmt.Printf("pop %d\n", Pop(&s) );
}
